<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let sum=0,count;
      let number = prompt("请输入一个数字");
      for (count= 1; count <= number; count++) {
        sum += count;
      }
      alert(`数字1到数字${number}之间的累加和为${sum}`);
    </script>
  </body>
</html>
